/*    */ package com.gopay.bis.gdb.ebank.gfbank.payment.merchant;
/*    */ 
/*    */ import java.io.FileInputStream;
/*    */ import java.io.InputStream;
/*    */ import java.io.PrintStream;
/*    */ import java.util.Properties;
/*    */ import java.util.ResourceBundle;
/*    */ 
/*    */ public class PayCfg
/*    */ {
/* 90 */   private static String rbname = "config";
/* 91 */   private static ResourceBundle prop_unix = null;
/* 92 */   private static boolean isPropLoaded = false;
/* 93 */   private static String profile = "config.properties";
/* 94 */   private static Properties prop_nt = new Properties();
/*    */ 
/*    */   public static void main(String[] args)
/*    */     throws Exception
/*    */   {
/* 10 */     Properties prop = new Properties(System.getProperties());
/* 11 */     prop.list(System.err);
/*    */ 
/* 13 */     System.err.println("os.name=" + System.getProperty("os.name"));
/* 14 */     System.err.println("file.separator=" + System.getProperty("file.separator"));
/* 15 */     System.err.println(getValue("ee"));
/*    */   }
/*    */ 
/*    */   public static String getValue(String key)
/*    */     throws Exception
/*    */   {
/* 26 */     Properties p = new Properties();
/* 27 */     InputStream in = null;
/*    */     try {
/* 29 */       in = new PayCfg().getClass().getClassLoader().getResourceAsStream(profile);
/* 30 */       p.load(in);
/*    */     } catch (Exception e) {
/* 32 */       e.printStackTrace();
/* 33 */       System.err.println("in PayCfg.getValue  Caught exception " + e.toString());
/* 34 */       throw e;
/*    */     }
/* 36 */     String ret = p.getProperty(key);
/* 37 */     if (ret == null) {
/* 38 */       System.err.println(key + " is not found in " + profile);
/* 39 */       throw new Exception(key + " is not found in " + profile);
/*    */     }
/* 41 */     return ret;
/*    */   }
/*    */ 
/*    */   public static String getValueAtUnix(String key)
/*    */     throws Exception
/*    */   {
/* 47 */     if (!isPropLoaded) {
/*    */       try {
/* 49 */         if ((PayCfg.prop_unix = ResourceBundle.getBundle(rbname)) != null) {
/* 50 */           isPropLoaded = true;
/*    */         }
/*    */ 
/*    */       }
/*    */       catch (Exception e)
/*    */       {
/* 59 */         e.printStackTrace();
/* 60 */         System.err.println("in PayCfg.getValue  Caught exception " + e.toString());
/* 61 */         throw e;
/*    */       }
/*    */ 
/*    */     }
/*    */ 
/* 66 */     return prop_unix.getString(key);
/*    */   }
/*    */ 
/*    */   public static String getValueAtNT(String key)
/*    */     throws Exception
/*    */   {
/* 72 */     if (!isPropLoaded) {
/*    */       try {
/* 74 */         prop_nt.load(new FileInputStream(profile));
/* 75 */         isPropLoaded = true;
/*    */       }
/*    */       catch (Exception e)
/*    */       {
/* 80 */         e.printStackTrace();
/* 81 */         System.err.println("in PayCfg.getValue  Caught exception " + e.toString());
/* 82 */         throw e;
/*    */       }
/*    */ 
/*    */     }
/*    */ 
/* 87 */     return prop_nt.getProperty(key);
/*    */   }
/*    */ }

/* Location:           D:\桌面\广发银行\B2C支付签名验签工具包\JAVA版\gfgate\WEB-INF\classes\
 * Qualified Name:     gfbank.payment.merchant.PayCfg
 * JD-Core Version:    0.6.0
 */